package com.bkhech.netty.httpwebsocket.pojo;

import cn.hutool.json.JSONUtil;
import io.netty.channel.Channel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * Request
 *
 * @author guowm
 * @date 2024-11-13
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class Request<T extends Message> {
    private MsgType msgType;
    private T message;
    private String extend;
    private Channel channel;

    public String toJsonStr() {
        return JSONUtil.toJsonStr(this);
    }
}
